<template>
	<view class="category">
		<view class="main" v-for="item in flList" :key="item.id" @tap="go(item.id)">
			<image :src="item.icon" mode=""></image>
			<text>{{item.name}}</text>
		</view>
	</view>
</template>

<script>
	import {

		findCategory,

	} from "../../api/home/index.js"
	import {
	
		findAllCategory,
	
	} from "../../api/kind/index.js"
	export default {
		data() {
			return {
				flList: [],
			}
		},
		onLoad() {
			this.getflList();
			

		},
		methods: {
			getflList() {
				findCategory("1308336521604599809").then(res => {
					console.log(res);
					this.flList = res.data.category.children;
					// console.log(this.flList)

				})
			},
			go(val){
				uni.navigateTo({
					url:`kindList/kindList?id=${val}`
				})
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	@import './css/kind.scss'

</style>
